import { Column, Entity, Index } from "typeorm";

@Index("idx_sur_role_id", ["roleId"], {})
@Index("idx_sur_user_id", ["userId"], {})
@Index("idx_sur_user_role_id", ["userId", "roleId"], {})
@Entity("sys_user_role", { schema: "workflow" })
export class SysUserRole {
    @Column("char", { primary: true, name: "id", comment: "主键id", length: 36 })
    id: string;

    @Column("char", {
        name: "user_id",
        nullable: true,
        comment: "用户id",
        length: 36,
    })
    userId: string | null;

    @Column("char", {
        name: "role_id",
        nullable: true,
        comment: "角色id",
        length: 36,
    })
    roleId: string | null;
}
